#include <iostream>
using namespace  std;

int main(int argc, char const *argv[]){
        bool b1 = true; //告诉c++编译器给我分配1个字节的内存

        cout<<"sizeof(bool): "<<sizeof(bool)<<endl; //1个字节

        //bool变量 要么是1 要么是0;  1是true 0是false
        b1 = 10;
        cout<<"b1:"<<b1<<endl; //不是10 是1

        b1 = -10;
        cout<<"b1:"<<b1<<endl;//还是1

        b1 = 0;
        cout<<"b1:"<<b1<<endl;//是0

        //bool b2,b3,b4,b5; //多个bool定义编译器可能将多个bool按位来存储
        return 0;
}
